#if 0

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <functional>
#include <stack>
using namespace std;

class Solution {
public:
    int static evalRPN(vector<string>& tokens) {

        map<string, function<int(int, int)>> m = {
            {"+", [](int lhs, int rhs) {return lhs + rhs; }},
            {"-", [](int lhs, int rhs) {return lhs - rhs; }},
            {"*", [](int lhs, int rhs) {return lhs * rhs; }},
            {"/", [](int lhs, int rhs) {return lhs / rhs; }}
        };

        stack<int> st;

        for (auto& e : tokens)
        {
            if (m.count(e))
            {
                int rhs = st.top();
                st.pop();
                int lhs = st.top();
                st.pop();

                st.push(m[e](lhs, rhs));
            }
            else
            {
                st.push(stoi(e));
            }
        }

        return st.top();
    }
};

int main()
{
    vector<string> tokens = { "2","1","+","3","*" };
    cout << Solution::evalRPN(tokens);



    return 0;
}
#endif